package com.crm.service.impl.csd.customerManager;

import com.crm.dao.mapper.customMapper.exchange.ProductExchangeCustomMapper;
import com.crm.model.entity.exchangeProductsRecord.ProductExchangeaApprovalExample;
import com.crm.common.model.DhPageInfo;
import com.crm.model.vo.csd.product.*;
import com.crm.model.vo.productManager.CustomerMemberProductVO;
import com.crm.model.vo.productManager.CustomerProductVO;
import com.crm.service.csd.customerManager.ProductExchangeDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.crm.dao.mapper.exchangeProductsRecord.ProductExchangeaApprovalMapper;

import java.util.List;

/**
 * @author wangpeng
 * @Date 2021/9/8
 */
@Service
public class ProductExchangeDbServiceImpl implements ProductExchangeDbService {

    @Autowired
    private ProductExchangeCustomMapper productExchangeMapper;

    @Autowired
    private ProductExchangeaApprovalMapper ProductExchangeaApprovalMapper ;


    /**
     * selectProductSceneList
     *       
     * @Author wangpeng
     * @Date 2021/9/9
     * @param order	
     * @return
     */
    @Override
    public List<sceneChangeCourseVO> selectProductSceneList(String order,Integer enableDisable) {
        return productExchangeMapper.selectProductSceneList(order,enableDisable);
    }

    /**
     * selectProductIndustryList
     *       
     * @Author wangpeng
     * @Date 2021/9/9
     * @param order	
     * @return
     */
    @Override
    public List<industryChangeCourseVO> selectProductIndustryList(String order,Integer enableDisable) {
        return productExchangeMapper.selectProductIndustryList(order,enableDisable);
    }

    /**
     * selectProductHighClassList
     *       
     * @Author wangpeng
     * @Date 2021/9/9
     * @param order	
     * @return
     */
    @Override
    public List<highClassChangeCourseVO> selectProductHighClassList(String order,Integer enableDisable) {
        return productExchangeMapper.selectProductHighClassList(order,enableDisable);
    }

    /**
     * selectProductList
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param order
     * @param productName
     * @return
     */
    @Override
    public List<CustomerProductVO> selectProductList(String order,String productName) {
        return productExchangeMapper.selectProductList(order,productName);
    }

    /**
     * addProductScene
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param course	
     * @return
     */
    @Override
    public Boolean addProductScene(sceneChangeCourseVO course) {
        return productExchangeMapper.addProductScene(course);
    }

    /**
     * addProductIndustry
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param course	
     * @return
     */
    @Override
    public Boolean addProductIndustry(industryChangeCourseVO course) {
        return productExchangeMapper.addProductIndustry(course);
    }

    /**
     * addProductHighClass
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param course	
     * @return
     */
    @Override
    public Boolean addProductHighClass(highClassChangeCourseVO course) {
        return productExchangeMapper.addProductHighClass(course);
    }

    /**
     * ProductHighClassList
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param ruleNumber	
     * @return
     */
    @Override
    public highClassChangeCourseVO ProductHighClassList(String ruleNumber) {
        return productExchangeMapper.ProductHighClassList(ruleNumber);
    }

    /**
     * ProductIndustryList
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param ruleNumber	
     * @return
     */
    @Override
    public industryChangeCourseVO ProductIndustryList(String ruleNumber) {
        return productExchangeMapper.ProductIndustryList(ruleNumber);
    }

    /**
     * ProductSceneList
     *       
     * @Author wangpeng
     * @Date 2021/9/10
     * @param ruleNumber	
     * @return
     */
    @Override
    public sceneChangeCourseVO ProductSceneList(String ruleNumber) {
        return productExchangeMapper.ProductSceneList(ruleNumber);
    }

    @Override
    public Boolean updateProductSceneEnableDisable(String id, String enableDisable) {
        return productExchangeMapper.updateProductSceneEnableDisable(id,enableDisable);
    }

    /**
     * selectChangeCourseRecord
     * @Author wangpeng
     * @Date 2021/9/26
     * @param order
 * @param vo
     * @return
     */
    @Override
    public List<ChangeCourseRecordVO> selectChangeCourseRecord(String order, ChangeCourseRecordVO vo) {
        return productExchangeMapper.selectChangeCourseRecord(order,vo);
    }

    /**
     * selectChangeCourseRecordRuleNumber
     * 查规则编号
     * @Author wangpeng
     * @Date 2021/9/26
     * @param
     * @return
     */
    @Override
    public List<ChangeCourseRecordVO> selectChangeCourseRecordRuleNumber() {
        return productExchangeMapper.selectChangeCourseRecordRuleNumber();
    }

    @Override
    public List<highClassExchangeDaysVO> selectHighClassExchangeDaysList(String order,Integer enableDisable) {
        return productExchangeMapper.selectHighClassExchangeDaysList(order,enableDisable);
    }

    @Override
    public Boolean addHighClassExchangeDays(highClassExchangeDaysVO vo) {
        return productExchangeMapper.addHighClassExchangeDays(vo);
    }

    @Override
    public Boolean updateIndustryChangeCourseEnableDisable(String id, String enableDisable) {
        return productExchangeMapper.updateIndustryChangeCourseEnableDisable(id,enableDisable);
    }

    @Override
    public Boolean updateHighClassEnableDisable(String id, String enableDisable) {
        return productExchangeMapper.updateHighClassEnableDisable(id,enableDisable);
    }

    @Override
    public Boolean updateHighClassExchangeDaysEnableDisable(String id, String enableDisable) {
        return productExchangeMapper.updateHighClassExchangeDaysEnableDisable(id,enableDisable);
    }

    @Override
    public List<siteExchangeIndustryVO> selectSiteExchangeIndustryList(String order, Integer enableDisable) {
        return productExchangeMapper.selectSiteExchangeIndustryList(order,enableDisable);
    }

    @Override
    public Boolean addSiteExchangeIndustry(siteExchangeIndustryVO vo) {
        return productExchangeMapper.addSiteExchangeIndustry(vo);
    }

    @Override
    public List<industryExchangeSiteVO> selectIndustryExchangeSiteList(String order, Integer enableDisable) {
        return productExchangeMapper.selectIndustryExchangeSiteList(order,enableDisable);
    }

    @Override
    public Boolean addIndustryExchangeSite(industryExchangeSiteVO vo) {
        return productExchangeMapper.addIndustryExchangeSite(vo);
    }

    @Override
    public Boolean updateSiteExchangeIndustryEnableDisable(String id, String enableDisable) {
        return productExchangeMapper.updateSiteExchangeIndustryEnableDisable(id,enableDisable);
    }

    @Override
    public Boolean updateIndustryExchangeSiteEnableDisable(String id, String enableDisable) {
        return productExchangeMapper.updateIndustryExchangeSiteEnableDisable(id,enableDisable);
    }

    @Override
    public List<CustomerMemberProductVO> selectHighCustomerMemberProductList(String order, String productName) {
        return productExchangeMapper.selectHighCustomerMemberProductList(order,productName);
    }

    /**
     * 兑换未审核
     * @return
     */
    @Override
    public Integer getProductExchangeNum() {
        ProductExchangeaApprovalExample example = new ProductExchangeaApprovalExample();
        example.or().andApprovalStatusEqualTo("1");
        return ProductExchangeaApprovalMapper.selectByExample(example).size();
    }


}
